﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Software41.Tracking.Tracing
{
    [Serializable]
    internal class WorkflowProcessTraceSource
    {
        private static string mTraceSourceName = "Software41.ProcessTrace";

        private static TraceSource GetWorkflowProcessInfoTrace()
        {

            var tsWorkflowProcessInfoTrace = new TraceSource(mTraceSourceName);
            
            //we want atleast Error
            if (tsWorkflowProcessInfoTrace.Switch.Level == SourceLevels.Off)
                tsWorkflowProcessInfoTrace.Switch.Level = SourceLevels.Error;

            return tsWorkflowProcessInfoTrace;
        }

        public static void TraceEvent(TraceEventType traceEventType,
                                        int id,
                                        string message)
        {
            var tsWorkflowProcessInfoTrace = GetWorkflowProcessInfoTrace();
            tsWorkflowProcessInfoTrace.TraceData(traceEventType,
                                                    id,
                                                    mTraceSourceName + " " + message);
           


        }
 
    }
}
